home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 January: Mac OS SDK / Dev.CD Jan 97 SDK2.toast / Development Kits (Disc 2) / OpenDoc Development Framework / ODFDev / ODF / Framewrk / FWPart / FWSclNot.h < prev    next >
Encoding:
Text File  |  1996-09-17  |  3.1 KB  |  115 lines  |  [TEXT/MPS ]

  1. //========================================================================================
  2. //
  3. //    File:                FWSclNot.h
  4. //    Release Version:    $ ODF 2 $
  5. //
  6. //    Copyright:    (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
  7. //
  8. //========================================================================================
  9.  
  10. #ifndef FWSCLNOT_H
  11. #define FWSCLNOT_H
  12.  
  13. #ifndef FWCONTRL_H
  14. #include "FWContrl.h"
  15. #endif
  16.  
  17. // ----- Foundation Layer -----
  18.  
  19. #ifndef FWNOTIFN_H
  20. #include "FWNotifn.h"
  21. #endif
  22.  
  23. // ----- OS Layer -----
  24.  
  25. #ifndef FWFXMATH_H
  26. #include "FWFxMath.h"
  27. #endif
  28.  
  29. #ifndef FWPOINT_H
  30. #include "FWPoint.h"
  31. #endif
  32.  
  33. // ----- OpenDoc Includes -----
  34.  
  35. #ifndef FWODTYPS_H
  36. #include "FWODTyps.h"
  37. #endif
  38.  
  39. class FW_CScrollBar;
  40.  
  41. //========================================================================================
  42. //    CLASS FW_CScrollNotification
  43. //========================================================================================
  44.  
  45. class FW_CScrollNotification : public FW_CControlNotification
  46. {
  47. public:
  48.     FW_DECLARE_CLASS
  49.  
  50.     FW_CScrollNotification(FW_CScrollBar* sb,
  51.                            FW_XYSelector direction,
  52.                            FW_Fixed delta,
  53.                            FW_Boolean shouldScroll = TRUE);
  54.     FW_CScrollNotification(const FW_CScrollNotification& other);
  55.     virtual                ~FW_CScrollNotification();
  56.  
  57.     FW_CScrollNotification&        operator=(const FW_CScrollNotification& other);
  58.  
  59.     FW_Boolean                    operator==(const FW_CScrollNotification& other) const;
  60.     FW_Boolean                    operator!=(const FW_CScrollNotification& other) const;
  61.     
  62.     // ----- Attributes
  63.     
  64.     FW_XYSelector        GetDirection(Environment* ev) const;
  65.     FW_Fixed            GetDelta(Environment* ev) const;
  66.     FW_Fixed            GetScrollPos(Environment* ev) const;
  67.  
  68.     // ----- Internal use
  69.     FW_Boolean            ShouldScroll(Environment* ev) const;
  70.  
  71. private:
  72.     FW_XYSelector        fDirection;
  73.     FW_Fixed            fDelta;
  74.     FW_Boolean            fShouldScroll;
  75. };
  76.  
  77. //----------------------------------------------------------------------------------------
  78. // FW_CScrollNotification::GetDirection
  79. //----------------------------------------------------------------------------------------
  80.  
  81. inline FW_XYSelector FW_CScrollNotification::GetDirection(Environment*) const
  82. {
  83.     return fDirection;
  84. }
  85.  
  86. //----------------------------------------------------------------------------------------
  87. // FW_CScrollNotification::GetDelta
  88. //----------------------------------------------------------------------------------------
  89.  
  90. inline FW_Fixed FW_CScrollNotification::GetDelta(Environment*) const
  91. {
  92.     return fDelta;
  93. }
  94.  
  95. //----------------------------------------------------------------------------------------
  96. // FW_CScrollNotification::ShouldScroll
  97. //----------------------------------------------------------------------------------------
  98.  
  99. inline FW_Boolean FW_CScrollNotification::ShouldScroll(Environment*) const
  100. {
  101.     return fShouldScroll;
  102. }
  103.  
  104. //----------------------------------------------------------------------------------------
  105. // FW_CScrollNotification::operator!=
  106. //----------------------------------------------------------------------------------------
  107.  
  108. inline FW_Boolean FW_CScrollNotification::operator!=(const FW_CScrollNotification& other) const
  109. {
  110.     return !(*this == other);
  111. }
  112.  
  113.  
  114. #endif
  115.